package com.software.chemistry.repository;

import com.software.chemistry.entity.Message;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
//沟通数据库和service层
@Repository
public interface MessageRepostiory extends JpaRepository<Message, String> {
    boolean deleteMessagesByReceiverId(String ReceiverId) ;
    boolean deleteMessagesByReceiverIdAndType(String Receiver, long Type) ;

    List<Message> findMessagesByReceiverIdAndTypeOrderByDate(String receiverId, long type);
    List<Message> findMessagesByReceiverIdAndSenderIdOrderByDate(String receiverId, String senderId);
}
